﻿Imports System.Security.Cryptography

<ContentType()>
Public Class Client
    Inherits BaseContent

    <ContentProperty()>
    Public Property name As ContentPropertyValue(Of String) = ""
    <ContentProperty()>
    Public Property XmlString As ContentPropertyValue(Of String) = ""
    <ContentProperty()>
    Public Property Token As ContentPropertyValue(Of String) = ""


    Private _rsa As RSACryptoServiceProvider
    Public Function getRsa() As RSACryptoServiceProvider
        If _rsa IsNot Nothing Then Return _rsa
        
        If String.IsNullOrEmpty(XmlString.value) Then Return Nothing

        Dim result As New RSACryptoServiceProvider()
        result.PersistKeyInCsp = False
        result.FromXmlString(XmlString)
        _rsa = result
        Return result
    End Function


End Class

